package com.bw.mapper;

import com.bw.bean.Vo;
import com.bw.bean.Vo1;
import com.bw.bean.Vo2;
import com.bw.bean.Vo3;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface VoMapper {
    @Select(
    "select hour(create_time) `num1`,count(1) `num2` from review_info where date_format(create_time,\"%Y:%m:%d\")=\"2025-4-17\"  group by num1;"
    )
    List<Vo> getList();
    @Select(
    "select tqi.id `num1`,tqi.question_txt `num2`,count(1) `num3`,count(is_correct=1) `num4`,(count(is_correct=1)/(select count(1) from test_exam_question)) from test_exam_question teq\n" +
            "left join edu.test_question_info tqi on tqi.id = teq.question_id GROUP BY num1;\n"
    )
    List<Vo1> getList1();
    @Select(
    "select te.paper_id `num1`,tp.paper_title `num2`,count(distinct user_id) `num3`,avg(score) `num4`,avg(duration_sec) `num5` from test_exam te\n" +
            "left join edu.test_paper tp on tp.id = te.paper_id\n" +
            "group by paper_id;"
    )
    List<Vo2> getList2();
    @Select(
    "select ci.course_name `num1`,count(distinct user_id) `num2` from review_info\n" +
            "left join edu.course_info ci on ci.id = review_info.course_id\n" +
            "group by num1;"
    )
    List<Vo3> getList3();
}
